package cqrtplm.controller;


import com.github.pagehelper.PageInfo;
import com.hustcad.plm.pdm.ec.module.dto.TyplmChangeIssueDetailDTO;
import com.hustcad.plm.pdm.workitem.model.vo.TyplmWorkItemTaskVO;
import com.ty.basic.response.ResponseResult;
import cqrtplm.constant.RouteConstant;
import cqrtplm.service.ProjectBoardService;
import cqrtplm.util.PageDtoUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author：lotus
 * @DATE: 2025/7/11 14:34
 */

@RestController
@Api(tags = "项目看板")
@RequestMapping(RouteConstant.BD + "board")
public class RTProjectBoardController {

    @Resource
    private ProjectBoardService projectBoardService;

    @PostMapping("/queryProjectWorkTask")
    @ApiOperation(value = "我管理的工作任务", produces = "application/json; charset=utf-8")
    public ResponseResult<PageDtoUtil> queryProjectWorkTask(@RequestParam(defaultValue = "1") Integer pageNum,
                                                            @RequestParam(defaultValue = "20") Integer pageSize,
                                                            @RequestBody(required = false) TyplmWorkItemTaskVO typlmWorkItemTaskVO){

       return ResponseResult.success(projectBoardService.queryProjectWorkTask(pageNum,pageSize,typlmWorkItemTaskVO));

    }

    @PostMapping("/queryProblemReport")
    @ApiOperation(value = "我管理的问题报告", produces = "application/json; charset=utf-8")
    public ResponseResult< PageInfo<TyplmChangeIssueDetailDTO>> queryProblemReport(@RequestParam(defaultValue = "1") Integer pageNum,
                                                                      @RequestParam(defaultValue = "20") Integer pageSize){

        return ResponseResult.success(projectBoardService.queryProblemReport(pageNum,pageSize));

    }
}

